package com.wyl.room

import android.os.Bundle
import androidx.activity.viewModels
import androidx.lifecycle.Observer
import com.wyl.baselib.base.BaseActivity
import com.wyl.room.adapter.UserListAdapter
import kotlinx.android.synthetic.main.activity_users.*

class UsersActivity : BaseActivity() {
    private val data by viewModels<UsersViewModel>()
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_users)

        val listAdapter = UserListAdapter()
        recyclerView.adapter = listAdapter

        data.users.observe(this, Observer {
//            recyclerView.adapter = UserAdapter(it)
            listAdapter.submitList(it)
        })
    }
}
